package chapter02;

import java.util.Scanner;

/**
 * 位运算符：一个整数每次执行位运算符中左移/右移运算n次，相当于这个整数乘以/除以2的n次方；好处：高效
 * Created by a on 2017/6/8.
 */
public class Test026 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入一个整数:");
        long number = scanner.nextLong();
        System.out.println("您输入的数字为:"+number);
        System.out.println("该数字乘以2的运算结果为:"+(number<<1));
        System.out.println("该数字乘以4的运算结果为:"+(number<<2));
        System.out.println("该数字乘以8的运算结果为:"+(number<<3));
        System.out.println("该数字乘以16的运算结果为:"+(number<<4));
    }
}
